<?php
session_start();
include('../soap.php');

$search = $_POST['word'];

$result = array();
 
$GetContact = new GetContact($wsdl);
$contacten = $GetContact->getContactenFromCriteria($search);

foreach($contacten as $contact)
{
	$result[] = $contact->getFullName();
}

 
// Finally the JSON, including the correct content-type
header('Content-type: application/json');
//var_dump($result);
echo json_encode($result);
 
?>